﻿using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DeZhen.Core.Framework.Locator
{

    public static class IocLocator
    {
        private static ServiceProvider Services { get; set; }
        public static void Buid(this IServiceCollection services)
        {
            Services = services.BuildServiceProvider();
        }
        public static T Resolve<T>()
        {
            return Services.GetServices<T>().ToList().FirstOrDefault();
        }
    }

}
